import Vue from 'vue';
//1s 防止重复点击
Vue.directive('lockClick',{
	inserted: function (el) {
		el.addEventListener('click',function(e){
            let oldTime = el.oldTime || 0;
            let nowTime = new Date().getTime();
            if(oldTime){
                oldTime = parseInt(oldTime);
                if(nowTime-oldTime<1000){
                    e.stopPropagation();
                }else{
                    el.oldTime = nowTime;
                }
            }else{
                el.oldTime = nowTime; 
            }
        },true);
	}
})